package com.gxa.jjty.core.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author NITRO
 */
public class OrderIdUtil {
    public static String getTime() {
        SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
        return sdfTime.format(new Date());
    }
    /**
     * 随机生成六位数随机码
     * @return
     */
    public static int getRandomNum(){
        return (int)(Math.random()*999999);
    }
    public static String getOrderId(){
        String s = getTime().replaceAll("[[\\s-:punct:]]", "");
        return s+getRandomNum();
    }
}
